from django.apps import AppConfig
import os

class rebuildIndex(AppConfig):
    name = 'index'  # 你的应用名

    def ready(self):
        from index.utils import rebuild
        rebuild()